<script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>
<form action="index.php?top=page&option=com_fractivitive" method="post" name="adminForm" id="adminForm" class="adminform">
<!-- LEFT -->
 <?php echo $this->loadTemplate('search','default') ?>
 <!-- END LEFT -->


 <!-- CONTENT -->
   <div id="jm-content">
        <h3 class="jm-title" style="position: relative;">
            <span class="jm_name">基本情報</span>
                <span class="right">

                    <label class="jm_name" style="margin-right:70px;" >更新日:<?php if($this->rows->ACTT_DATE!='0000-00-00') echo HelperBG::F_GetDate_JP($this->rows->ACTT_DATE); ?></label>
                    <!-- <button style="float: right;position:absolute;right:5px;top:1px;" href="index.php?top=page&option=com_fractivitive&task=defaut">一覧戻る</button> -->
                    <button style="float: right;position:absolute;right:5px;top:1px;" onClick="Joomla.submitbutton('default');">一覧戻る</button>
                </span>
        </h3>
        <div class="content">
            <div id="basic">
                <label class="title_">基本データ</label>
                <div class="twooo">
                    <p>
                        <label class="title">【名称】</label>
                        <label><?php echo  $this->rows->ACTT_NAME; ?></label>
                    </p>

                    <p>
                        <label class="title">【オススメ度】</label>
                        <label>
                            <?php $a= $this->rows->ACTT_RECOMMENDED_DEGREE;
                                for($i=1;$i<=$a;$i++) echo '<img height="14" src="components/com_fractivitive/public/images/hoshi.gif" width="14" />';
                            ?>
                        </label>
                    </p>

                    <p>
                        <label class="title">【センター・クラブ】</label>
                        <label><?php echo  $this->rows->OCBA_NAME; ?></label>
                    </p>

                    <p>
                        <label class="title">【期間】</label>
                         <label><?php echo HelperBG::F_GetDate_JP($this->rows->ACTT_PERIOD_START); echo ' ～ '; ?>
                                <?php echo HelperBG::F_GetDate_JP($this->rows->ACTT_PERIOD_FINISH); ?>
                        </label>
                    </p>

                    <p>
                        <label class="title">【募集ステータス】</label>
                        <label><?php if($this->rows->ACTT_RECR==1) echo '募集開始前'; elseif($this->rows->ACTT_RECR==2) echo '募集中'; else echo '募集終了'; ?></label>
                    </p>
                    <p>
                        <label class="title">【会場】</label>
                        <label><?php echo  $this->rows->ACTT_VENUE; ?></label>
                    </p>
                    <p>
                        <label class="title">【主催】</label>
                        <label><?php echo  $this->rows->ACTT_TOCHUC; ?></label>
                    </p>
                    <p>
                        <label class="title">【後援】</label>
                        <label><?php echo  $this->rows->ACTT_TAITRO; ?></label>
                    </p>
                    <p>
                        <label class="title">【協力】</label>
                        <label><?php echo  $this->rows->ACTT_COOPERATION; ?></label>
                    </p>
                    <p>
                        <label class="title">【問合せ先】</label>
                        <label><?php echo  $this->rows->ACTT_CONTACT; ?></label>
                    </p>
                    <p>
                        <label class="title">【問合せ先担当】</label>
                        <label><?php echo  $this->rows->ACTT_PERSON; ?></label>
                    </p>
                    <p>
                        <label class="title">【問合せ先TEL】</label>
                        <label><?php echo  $this->rows->ACTT_TEL; ?></label>
                    </p>
                </div>
            </div>

        <table cellspacing="0" cellpadding="0" width="100%" border="0">
               
                <tr >
                    <td colspan="4"><hr /></td>
                </tr>
                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tbody>
                        <tr>
                            <td style="width: 122px;"><label class="title_">事業概要</label></td>
                            <td style="width: 125px;">【趣旨】</td>
                            <td colspan="2"><?php echo  $this->rows->ACTT_EFFECT; ?></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>【対象】</td>
                            <td style="width: 54%;">
                                <?php echo  $this->rows->ACTT_TARGET; ?>
                            </td>
                            <td style="width: 15%;">性別：<?php if ($this->rows->ACTT_SEX==1) echo '男性'; else if($this->rows->ACTT_SEX==2) echo '女性'; else echo '全て'; ?></td>

                        </tr>
                        <tr>
                            <td></td>
                            <td>【参加人数】</td>
                            <td><?php if($this->rows->ACTT_NUMBER_OF_PARTICIPANTS == 'null' || $this->rows->ACTT_NUMBER_OF_PARTICIPANTS == ''){ echo ' '; }else{echo $this->rows->ACTT_NUMBER_OF_PARTICIPANTS.'人';} ?> </td>
                        </tr>


                        <tr>
                            <td></td>
                            <td>【参加費】</td>
                            <td colspan="2"><?php if($this->rows->ACTT_ENTRY_FEE == 'null' || $this->rows->ACTT_ENTRY_FEE == '') { echo ' ';} else{ echo $this->rows->ACTT_ENTRY_FEE.'円'; }?></td>

                        </tr>
                        <tr>
                            <td></td>
                            <td>【総事業費】</td>
                            <td colspan="2"><?php if($this->rows->ACTT_TOTAL_PROJECT_COST == 'null' || $this->rows->ACTT_TOTAL_PROJECT_COST == ''){ echo ' '; }else{echo $this->rows->ACTT_TOTAL_PROJECT_COST.'円';} ?> </td>

                        </tr>
                        <tr>
                            <td></td>
                            <td>【事業内容】</td>
                            <td colspan="2"><?php echo HelperBGtop::newline2br($this->rows->ACTT_BUSINESS); ?></td>

                        </tr>
                        <tr>
                            <td></td>
                            <td>【備考】</td>
                            <td colspan="2"><?php echo $this->rows->ACTT_REMARKS; ?></td>
                        </tr>
                    </tbody>
                </table>

                <tr>
                    <td colspan="4"><hr /></td>
                </tr>
                    <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tbody>
                        <tr>
                            <td style="width: 122px;" ><label class="title_">ジャンル</label></td>
                            <td class="">【施設】</td>
                            <?php
                            $ar=explode(",",$this->rows->ACTT_MFAC_CODE_LIST);
                                $i=0;
                                $count_all=count($this->mfac);

                                foreach ($this->mfac as $key=>$value)
                                {
                                    $str='<font size="2" face="ＭＳ Ｐゴシック, Osaka" class="font03">□</font>';
                                    $i++;
                                    $count_all--;
                            ?>
                            <td style="width: 23%;">

                                <?php foreach ($ar as $k=>$vl)
                                    {
                                        if ($value->MFAC_CODE==$vl)
                                        {
                                            $str='■';
                                        }
                                    }

                                ?>
                                <?php echo $str.$value->MFAC_NAME;$str='□'; ?>
                                <?php
                                    if ($i==3 && $count_all>0)
                                    {
                                        $i=0;
                                        echo "</td></tr><tr><td></td><td>";
                                    }
                                ?>
                            </td>

                            <?php } ?>

                        </tr>
                        <tr>
                            <td></td>
                            <td>【対象】</td>
                            <?php
                            $ar=explode(",",$this->rows->ACTT_MOBJ_CODE_LIST);

                                $i=0;
                                $j=count($this->mobj);
                                foreach ($this->mobj as $k=>$value)
                                {
                                    $str='□';
                                    $i++;
                                    $j--;
                             ?>
                            <td>

                                        <?php foreach ($ar as $k=>$vl)
                                    {
                                        if ($value->MOBJ_CODE==$vl)
                                        {
                                           $str='■';
                                        }
                                    }
                                        ?>

                                 <?php echo $str.$value->MOBJ_NAME;$str='□'; ?>
                                <?php
                                    if ($i==3 && $j>0)
                                    {
                                        $i=0;
                                        echo "</td></tr><tr><td></td><td>";
                                    }
                                ?>
                            </td>
                            <?php } ?>

                        </tr>

                        <tr>
                            <td></td>
                            <td>【内容】</td>
                            <?php
                                $ar=explode(",",$this->rows->ACTT_MCON_CODE_LIST);
                                $i=0;
                                $j=count($this->mcon);
                                foreach ($this->mcon as $key=>$value)
                                {
                                    $str='□';
                                    $i++;
                                    $j--;
                            ?>
                            <td>

                                    <?php foreach ($ar as $k=>$vl)
                                    {
                                        if ($value->MCON_CODE==$vl)
                                        {
                                            $str='■';
                                        }
                                    }
                                        ?>
                                <?php echo $str.$value->MCON_NAME;$str='□'; ?>
                                <?php
                                    if ($i==3 && $j>0)
                                    {
                                        $i=0;
                                        echo "</td></tr><tr><td></td><td>";
                                    }

                                ?>
                            </td>
                            <?php } ?>

                        </tr>

                    </tbody>
                </table>
                <tr>
                    <td colspan="4"><hr /></td>
                </tr>
                <div>
                    <label class="imgdc title_">画像</label>
                    <div class="full_img">
                        <?php

                        for($i = 1; $i < 6; $i++){
                            if($this->rows->{'ACTT_IMAGE_'.$i} != null){
                                echo '<div class ="desc">';
                                    echo "<p class='img_desc'><img class='imgdetail' src='uploads/images/com_activity/{$this->rows->{'ACTT_IMAGE_'.$i}}' /><p>";

                                    if($this->rows->{'ACTT_IMAGE_'.$i} != null && $this->rows->{'ACTT_DECR_IMG_'.$i} != null ){
                                        echo $this->rows->{'ACTT_DECR_IMG_'.$i};
                                    }
                                $bot = $i != 5 ? "borderBot" : null;

                                echo "</div><p class='$bot'/>";
                            }
                        }
                        ?>
                    </div>
                </div>

                    <tr>
                    <td colspan="4"><hr style="clear: left"/></td>
                    </tr>
                    <!-- show ACTT_ATTACHMENT -->
                    <table cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tbody>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_">添付ファイル</label></td>
                                <td style="width: 15%;">添付ファイル1</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_1;
                                        //$urlFile = urlencode($file_name);

                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_1) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_1);
                                            $this->rows->ACTT_ATTACHMENT_1 = substr($this->rows->ACTT_ATTACHMENT_1,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_1 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_1.'</a>';

                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_1 != null && $this->rows->ACTT_DECR_ATT_1 != null ){ ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;"></td>
                                <td style="padding-left: 5px;"><?php echo $this->rows->ACTT_DECR_ATT_1; ?></td>
                            </tr>
                            <?php } ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;">添付ファイル2</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_2;
                                        //$urlFile = urlencode($file_name);
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_2) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_2);
                                            $this->rows->ACTT_ATTACHMENT_2 = substr($this->rows->ACTT_ATTACHMENT_2,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_2 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_2.'</a>';
                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_2 != null && $this->rows->ACTT_DECR_ATT_2 != null ){ ?>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="padding-left: 5px;"><?php echo $this->rows->ACTT_DECR_ATT_2; ?></td>
                            </tr>
                            <?php } ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;">添付ファイル3</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_3;
                                        //$urlFile = urlencode($file_name);
                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_3) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_3);
                                            $this->rows->ACTT_ATTACHMENT_3 = substr($this->rows->ACTT_ATTACHMENT_3,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_3 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_3.'</a>';
                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_3 != null && $this->rows->ACTT_DECR_ATT_3 != null ){ ?>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="padding-left: 5px;"><?php echo $this->rows->ACTT_DECR_ATT_3; ?></td>
                            </tr>
                            <?php } ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;">添付ファイル4</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_4;
                                        //$urlFile = urlencode($file_name);
                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_4) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_4);
                                            $this->rows->ACTT_ATTACHMENT_4 = substr($this->rows->ACTT_ATTACHMENT_4,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_4 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_4.'</a>';
                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_4 != null && $this->rows->ACTT_DECR_ATT_4 != null ){ ?>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="padding-left: 5px;"><?php echo $this->rows->ACTT_DECR_ATT_4; ?></td>
                            </tr>
                            <?php } ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;">添付ファイル5</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_5;
                                        //$urlFile = urlencode($file_name);
                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_5) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_5);
                                            $this->rows->ACTT_ATTACHMENT_5 = substr($this->rows->ACTT_ATTACHMENT_5,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_5 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_5.'</a>';
                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_5 != null && $this->rows->ACTT_DECR_ATT_5 != null ){ ?>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="padding-left: 5px;"><?php echo $this->rows->ACTT_DECR_ATT_5; ?></td>
                            </tr>
                            <?php } ?>
                            <tr>
                                <td style="width: 122px;vertical-align: top;"><label class="title_"></label></td>
                                <td style="width: 15%;">添付ファイル6</td>
                                     <?php
                                        $file_name = $this->rows->ACTT_ATTACHMENT_6;
                                        //$urlFile = urlencode($file_name);
                                        //$dowi_path  = "index.php?option=com_download_file&task=download&folder=files/com_activity&file=".$urlFile;
                                        $dowi_path  = "download.php?folder=files/com_activity&file=".$file_name;
                                        //$encode_filename = sha1($file_name);
                                        //$check_file = "uploads/files/com_activity/$encode_filename";
                                        $check_file = "uploads/files/com_activity/$file_name";
                                    ?>
                                <td>
                                        <?php
                                        if(strlen($this->rows->ACTT_ATTACHMENT_6) > 40){
                                            $n_file = explode('.', $this->rows->ACTT_ATTACHMENT_6);
                                            $this->rows->ACTT_ATTACHMENT_6 = substr($this->rows->ACTT_ATTACHMENT_6,0,30).'.'.end($n_file);
                                        }
                                            if(file_exists($check_file)){
                                               ?>
                                                <a href="<?php echo $dowi_path; ?>"><?php echo  $this->rows->ACTT_ATTACHMENT_6 ;?></a>
                                             <?php
                                             }
                                             else
                                                echo '<a href="javascript:alertError();">'.$this->rows->ACTT_ATTACHMENT_6.'</a>';
                                            ?>
                                </td>
                            </tr>
                            <?php if($this->rows->ACTT_ATTACHMENT_6 != null && $this->rows->ACTT_DECR_ATT_6 != null ){ ?>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="padding-left: 5px;"> <?php echo $this->rows->ACTT_DECR_ATT_6; ?></td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </table>
            <input type="hidden" name="task" value=""/>
            <input type="hidden" name="limitstart" value="<?php echo JRequest::getVar('limitstart'); ?>">

        </div>
   </form>
 <!-- END CONTENT -->
 <script>
    function alertError(){
        /*alert("KHONG TIM THAY FILE");*/
        alert("ファイルが見つかりません。");
    }
</script>

